import logging

from .config import Config
from .task import TaskManager, TaskQueue


LOG = logging.getLogger(__name__)


class Scheduler:

    def __init__(self, config: Config):
        self.config = config

    def main(self):
        with TaskQueue(self.config) as queue:
            while True:
                task = queue.get()
                task_manager = TaskManager(task)
                task_manager.run()
